How to return a verbatim string from ConfigurationManager.AppSetting["settingname"].ToString()

Posted by Josh H. on Stack Overflow See other posts from Stack Overflow or by Josh H.
Published on 2009-10-20T14:29:16Z Indexed on 2010/03/28 17:03 UTC
Read the original article Hit count: 338

I am using the ConfigurationManager.AppSetting["blah"].ToString() method to get the path to the folder that contains the files I'm needing. But I'm throwing an UnsupportedFormatException on the path when it tries to use Directory.GetFiles(path).

The returning value has the escape characters included and I'm not sure how to keep it from returning the extra characters. This is what the path looks like after it is returned:

\\\\\\\\C:\\\\folder1\\\\folder2

© Stack Overflow or respective owner

Related posts about configurationmanager

Related posts about appsettings